﻿<!DOCTYPE html>
<!--
BeyondAdmin - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.2.0
Version: 1.0.0
Purchase: http://wrapbootstrap.com
-->

<html xmlns="http://www.w3.org/1999/xhtml">

<!-- Head -->
{include file="common/header" /}
<!-- /Head -->

<!-- Navbar -->
{include file="common/navbar" /}
<!-- /Navbar -->
<!-- Main Container -->
<div class="main-container container-fluid">
    <!-- Page Container -->
    <div class="page-container">


        <!-- Page Sidebar -->
        {include file="common/menu" /}
        <!-- /Page Sidebar -->


        <!-- Page Content -->
        <div class="page-content">
            <!-- Page Breadcrumb -->
            <div class="page-breadcrumbs">
                <ul class="breadcrumb">
                    <li>
                        <i class="fa fa-home"></i>
                        <a href="{:url('Index/index')}">系统</a>
                    </li>
                    <li>
                        <a href="{:url('Cate/lst')}">分类管理</a>
                    </li>
                    <li class="active">添加分类</li>
                </ul>
            </div>
            <!-- /Page Breadcrumb -->
            <!-- Page Header -->
            <div class="page-header position-relative">
                <div class="header-title">
                    <h1>
                        分类管理
                    </h1>
                </div>
                <!--Header Buttons-->
                <div class="header-buttons">
                    <a class="sidebar-toggler" href="#">
                        <i class="fa fa-arrows-h"></i>
                    </a>
                    <a class="refresh" id="refresh-toggler" href="">
                        <i class="glyphicon glyphicon-refresh"></i>
                    </a>
                    <a class="fullscreen" id="fullscreen-toggler" href="#">
                        <i class="glyphicon glyphicon-fullscreen"></i>
                    </a>
                </div>
                <!--Header Buttons End-->
            </div>
            <!-- /Page Header -->
            <!-- Page Body -->
            <div class="page-body">


                <!-- Your Content Goes Here -->
                <button type="button" tooltip="添加用户" class="btn btn-sm btn-azure btn-addon" onClick="javascript:window.location.href = '{:url("Cate/add")}'"> <i class="fa fa-plus"></i> Add
                </button>
                <div class="row">
                    <div class="col-lg-12 col-sm-12 col-xs-12">
                        <div class="widget">
                            <div class="widget-body">
                                <div class="flip-scroll">
                                    <table class="table table-bordered table-hover">
                                        <thead class="">
                                            <tr>
                                                <th class="text-center" width="8%">ID</th>
                                                <th class="text-center">分类名称</th>
                                                <th width="12%">类型</th>
                                                <th class="text-center" width="8%">显示到导航栏</th>
                                                <th class="text-center" width="8%">排序</th>
                                                <th class="text-center" width="14%">操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {volist name="cateRes" id="vo"}
                                            <tr>
                                                <td align="center">{$vo.id}</td>
                                                <td><?php echo str_repeat('-',$vo['level']*8);?>{$vo.cate_name}</td>
                                                <td>{$vo.cate_type}</td>
                                                <td align="center">
                                                    {eq name="vo.show_nav" value="1"}
                                                    是
                                                    {else /}
                                                    否
                                                    {/eq}
                                                </td>
                                                <td align="center"><input type="text" style="width: 50px; text-align: center;" name="sort" value="{$vo.sort}"></td>
                                                <td align="center">
                                                    <a href="{:url('edit',array('id'=>$vo['id']))}" class="btn btn-primary btn-sm shiny edit">
                                                        <i class="fa fa-edit"></i> 编辑
                                                    </a>
                                                    <a href="{:url('del',array('id'=>$vo['id']))}" class="btn btn-danger btn-sm shiny del">
                                                        <i class="fa fa-trash-o"></i> 删除
                                                    </a>
                                                </td>
                                            </tr>
                                            {/volist}
                                        </tbody>
                                    </table>
                                    
                                </div>
                                <div style="padding-top: 10px; text-align: right;">

                                </div>
                            </div>
                        </div>
                    </div>
                </div>


            </form>
        </div>
    </div>
</div>
</div>
</div>
<!-- /Page Body -->


</div>
<!-- /Page Content -->
</div>
<!-- /Page Container -->
<!-- Main Container -->

</div>

<!--Basic Scripts-->
{include file="common/base_js" /}

<!--Page Related Scripts-->

<script>
    layui.use('layer', function(){
        var $ = layui.$
        ,layer = layui.layer;

        // 删除弹窗
        $('.del').on('click',function () {
            var url = this.href;
            // alert(url);
            //弹出窗口代码
            layer.confirm('确定要删除吗？', {icon: 3, title:'提示'}, function(index){
                //do something
                location.href = url;
                layer.close(index);
            });
            return false;
        });

        // 编辑弹窗
        $('.edit').on('click',function () {
            var url = this.href;
            // alert(url);
            location.href = url;
            return false;
        });


    }); 
</script>


</body>
<!--  /Body -->
</html>
